﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[StepsJsonFormat]
@ProcessVersionID int
AS
BEGIN
	 SELECT cast(StepID as varchar(50)) as id,
	  case 
		when cast(ParentStepID as varchar(50)) = 0 then '#'
		else isnull(cast(ParentStepID as varchar(50)),'#') END as parent
	 ,StepName as [text],'{"opened":"true"}' as state, [Type]
	  FROM Steps where ProcessVersionID = @ProcessVersionID
END
